#ifndef	EPUCK_IMPL_HPP__
#define	EPUCK_IMPL_HPP__

#include <string>
using std::string;

#include "EpuckInterface.hpp"
#include "epuck_types.hpp"
#include "EpuckImage.hpp"

namespace gui
{
	// map, for macAddress?

	class EpuckImpl: public EpuckInterface
	{
		EpuckID	epuck;
		int	sock;		// not completely understood
		char	buffer[10000];	// not sure about the size
		int	version;	// this also begs for its own class
		int	helptextlength;

		int readline( char* begin, int max_size );
		void sendCommand( const char* cmd, char* answer,
				int maxAnswerLength, int numAnswerLines);
		bool testBuffer( char const *s );
	public:
		EpuckImpl(const EpuckID epuck);
		~EpuckImpl();

		void setBodyLED(LEDState state);
		void setFrontLED(LEDState state);
		void setLED(int number, LEDState state);

		void setMotorSpeed(int left, int right);
		Int2 getMotorSpeed();
		void setMotorPosition(int left, int right);
		Int2 getMotorPosition();
		void stopRobot();

		void calibrateProximitySensors();	
		Int8 getProximitySensors();
		Int8 getLightSensors();
		Int3 getAccelerometer();

		void getCameraImage(EpuckImage &image)
		{ image = cameraShot(); }
		EpuckImage &cameraShot();

		void playSound(int sampleNo);
		Int3 getMicrophones();

		int getSelectorPosition();
		string getHelpText();
		string getVersion();
	};
}

#endif

